﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SortRotateFind
{
    public class SortRotateFindMain
    {
        static void Main(string[] args)
        {
            SortRotateFind mysortRotateFind = new SortRotateFind();
            Console.WriteLine("Sorted array");
            
            int[] array = new int[] { 4, 5, 2, 9, 3, 7 };
            Array.Sort(array);
            int minx = array[0];
            mysortRotateFind.Rotate(ref array);
            mysortRotateFind.Rotate(ref array);
            mysortRotateFind.Rotate(ref array);
            
            for (int i = 0; i < array.Length; i++)
            {
                Console.Write(" " + array[i]);    
            }
            Console.WriteLine("\n Result");
            //find minimum int
            int result = mysortRotateFind.Min(array);
            Console.WriteLine("Results: " + result);
            Console.ReadLine();
        }

        

    }
}
